      <!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
	<!-- <title>test</title> -->
	<style type="text/css">
		html{
			margin: 0;
			padding: 0;
			height: 100%;
			width: 100%;
		}
		body{
			margin: 0;
			padding: 0;
			height: 100%;
			width: 100%;
			background: url({$bg->background?$bg->background:'http://weidogstest.oss-cn-beijing.aliyuncs.com/0c1c0e03f3b807fa3498aaa2098834e5.jpg'}) no-repeat center;
			background-size: 100% auto;

		}
		.OpenButton_container{
			position: absolute;
			bottom: 0;
			height: 9.3rem;
			width: 100%;
			/*display: flex;
			justify-content: center;
			align-items: center;*/
		}
		wx-open-launch-weapp{
			height: 100%;
			width: 100%;
			display: block;
		}
	</style>
</head>
<body>
	<div class="OpenButton_container">
		<wx-open-launch-weapp id="launch-btn" username="{$customqr->xcx_appid}" path="{$customqr->xcx_url}">
		  <script type="text/wxtag-template">
		    <style>.btn { padding: 12px}.OpenButton { margin: 0 auto 0 auto;appearance: none;outline: none;border: none;background: #ffd35d;color: #fff;font-size: 19px;width:280px;height:60px;border-radius: 30px;display: block;}</style>

		    <button class="btn OpenButton">{$bg->text?$bg->text:'立即点餐'}</button>
		  </script>
		</wx-open-launch-weapp>

	</div>
	<script src="/cdn/jquery.min.10.js"></script>
	<script src="https://res.wx.qq.com/open/js/jweixin-1.6.0.js"></script>
	<script type="text/javascript">
		(function (doc, win) {
		    var docEl = doc.documentElement,
		    resizeEvt = 'orientationchange' in window ? 'orientationchange' : 'resize',
		    recalc = function () {
		        var clientWidth = docEl.clientWidth;
		        if (!clientWidth) return;
		        docEl.style.fontSize = 64 * (clientWidth / 640) + 'px';
		    };
		    if (!doc.addEventListener) return;
		    win.addEventListener(resizeEvt, recalc, false);
		    doc.addEventListener('DOMContentLoaded', recalc, false);
		})(document, window);
		wx.config({
		  debug: false, // 开启调试模式,调用的所有api的返回值会在客户端alert出来，若要查看传入的参数，可以在pc端打开，参数信息会通过log打出，仅在pc端时才会打印。
		  appId: "{$wxConfig['appId']}", // 必填，公众号的唯一标识
		  timestamp: "{$wxConfig['timestamp']}", // 必填，生成签名的时间戳
		  nonceStr: "{$wxConfig['nonceStr']}", // 必填，生成签名的随机串
		  signature: "{$wxConfig['signature']}",// 必填，签名
		  jsApiList: ['openLocation','chooseImage', 'previewImage'], // 必填，需要使用的JS接口列表
		  openTagList: ['wx-open-launch-weapp'] // 可选，需要使用的开放标签列表，例如['wx-open-launch-app']
		});
		wx.ready(function(){
		  var btn = document.getElementById('launch-btn');
		  btn.addEventListener('launch', function (e) {
		    console.log('success');
		  });
		  btn.addEventListener('error', function (e) {
		    console.log('fail', e.detail);
		  });	
		});
		wx.error(function(res){
		  alert(res.errMsg);
		});
	</script>
</body>

</html>